package com.jdrx.ocp.beans.entity.util;

import java.util.regex.Pattern;

/**
 * @Author: Huangxg
 * @Date: 2019/4/15 13:09
 */
public class ExceptionMessageFilter {

    public static Pattern ERROR_REGEX = Pattern.compile(".*?###.*?");

    /**
     * 非指定异常类信息过滤
     * @param message
     * @return
     */
    public static String filter(String message){
        if(ERROR_REGEX.matcher(message.trim()).matches()) {
            return "操作异常，请重新尝试！";
        }
        return message;
    }

}
